import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity("ota_device", { schema: "charge" })
export class OtaDevice {
  @PrimaryGeneratedColumn({ type: "int", name: "id", unsigned: true })
  id: number;

  @Column("int", {
    name: "task_id",
    comment: "任务id",
    unsigned: true,
    default: () => "'0'",
  })
  taskId: number;

  @Column("int", {
    name: "device_id",
    comment: "设备",
    unsigned: true,
    default: () => "'0'",
  })
  deviceId: number;

  @Column("tinyint", {
    name: "status",
    comment: "0：进行中，1：完成，2：失败，3：离线",
    default: () => "'0'",
  })
  status: number;

  @Column("int", {
    name: "complete_time",
    comment: "结束时间",
    unsigned: true,
    default: () => "'0'",
  })
  completeTime: number;
}
